package cn.sciento.farm.devicemanager.fjhsxq.model.common.sensor;

public enum  SensorTypeEnum {

    airH("空气湿度", "airH",1),
    airT("空气温度", "airT",2),
    ill("光照度", "ill",3),
    co2("二氧化碳", "co2",4),
    PAR("光合辐射度", "PAR",5),
    rainF("降雨量", "rainF",6),
    windS("风力", "windS",7),
    windD("风向", "windD",8),
    soilT("土壤温度", "soilT",9),
    soilH("土壤湿度", "soilH",10),
    DO("溶解氧", "DO",13),
    LiquidT("水温度", "LiquidT",14),
    pm25("PM2.5", "pm25",15),
    atm("气压", "atm",16),
    level("水位", "level",17),
    sleet("雨雪", "sleet",18),
    soilS("土壤盐分", "soilS",21),
    NH3("氨气", "NH3",27),
    turbidity("浊度", "turbidity",29),
    NH3N("氨氮含量","NH3N",31),
    wPH("湿式PH值", "wPH",33);

    private String name;
    private String type;
    private Integer code;

    private SensorTypeEnum(String name, String type, Integer code){
        this.type = type;
        this.code = code;
        this.name = name;
    }

    public static String getCode(String type) {
        for (SensorTypeEnum sensorTypeEnum : SensorTypeEnum.values()) {
            if (sensorTypeEnum.getType().equals(type)) {
                return String.valueOf(sensorTypeEnum.getCode());
            }
        }
        return null;

    }

    public String getType() {
        return type;
    }

    public Integer getCode() {
        return code;
    }

}
